<template>
  <div>
    <h1 v-if="user === 'svip'">欢迎大佬</h1>
<!--    <h1 v-else>充值变强</h1>-->
    <button @click="toggleUser">VIP过期</button>

    <!--  设置内容切换  -->
    <h1 v-show="isShow">111</h1>
    <button @click="toggleShow">VIP过期</button>

  </div>
</template>

<script>
// 声明式
export default {
  name: 'App',
  data() {
    return {
      user: 'svip',
      isShow:true

    }
  },
  methods: {
    toggleUser() {
      this.user = 'vip'
    },
    toggleShow(){
      this.isShow = !this.isShow
    }
  }
}
</script>

<style>
.active {
  /*width: 100px;*/
  /*height: 100px;*/
  background-color: yellowgreen;
}

#d2 {
  width: 100px;
  height: 100px;
  background-color: blue;
}
</style>